package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.pojo.*;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface MemberDao {

    /**
     * 会员信息条件查询
     * @param queryString
     * @return
     */
    Page<CheckItem> selectByCondition(String queryString);

    /**
     * 新增会员信息
     * @param member
     */
    public void add(Member member);

    /**
     * 编辑会员信息
     * @param member
     */
    public void edit(Member member);

    /**
     * 删除会员信息
     * @param id
     */
    public void deleteById(Integer id);

    Member findById(Integer memberId);

    @Select("select * from t_member where id = #{id} ")
    Usermanage selectById(Integer valueOf);

    @Select("select id from t_order where member_id = #{id}")
    List<Integer> findId(Integer memberId);

    @Select("select a.address from t_address a,t_order_address oa where oa.order_id = #{id} and a.id = oa.address_id")
    String findAddress(Integer integer);

    @Select("select setmeal_id from t_order where member_id = #{id}")
    List<Integer> findSetmealId(Integer memberId);

    Setmeal findSetmealByMemberId(Integer integer);

    List<CheckGroup> selectGroup(int id);

    @Select("select * from t_checkgroup_checkitem cc,t_checkitem c where cc.checkgroup_id = #{id} and cc.checkitem_id = c.id")
    List<CheckItem> selectCheckItem(int id);
}
